<template>
  <div>
    <el-form v-for="form in formData" :model="form" label-width="80px">
      <el-form-item v-show="form.type === 'text'" :label="form.label" @input="input">
        <el-input v-model="form.value" :type="form.type"></el-input>
      </el-form-item>
      <el-form-item v-show="form.type === 'textarea'" :label="form.label" prop="desc">
        <el-input v-model="form.value" :type="form.type" />
      </el-form-item>
      <el-form-item v-show="form.type === 'select'" :label="form.label" prop="desc">
        <el-select v-model="form.value" clearable placeholder="请选择">
          <el-option
            v-for="item in form.options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
    </el-form>
  </div>
</template>
<script lang="ts" setup>
import { def } from "@vue/shared";
import { emit } from "process";
import { defineProps, defineEmits } from "vue";
const prop = defineProps({
  formData: Array,
});
const emits = defineEmits(["formData"]);
const getData = () => {
  emits(
    "formData",
    prop.formData.map((item) => item.value)
  );
};
</script>
